﻿#include <stdio.h>
#include <math.h>

//7-1 输出闰年
void ex_7_1()
{
	int start_year = 2000;
	int end_year = 2000;

	scanf("%d", &end_year);

	for (int year = start_year; year <= end_year; year++) {
		if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
			printf("%d\n", year);
		}
	}
}

//7-2
void ex_7_2()
{
	int score = 0;
	scanf("%d", &score);
	/*
	// if-else
	if (score >= 90) {
		putchar('A');
	}
	else if (score >= 80) {
		putchar('B');
	}
	if (score >= 70) {
		putchar('C');
	}
	if (score >= 60) {
		putchar('D');
	}
	else {
		putchar('E');
	}
	*/

	/*
	// switch-case
	switch (score / 10)
	{
	case 10:
	case 9: putchar('A'); break;
	case 8: putchar('B'); break;
	case 7: putchar('C'); break;
	case 6: putchar('D'); break;
	default: putchar('E'); break;
	}
	*/

	// dictionary
	char grade[] = "EEEEEEDCBAA";
	printf("%c\n", grade[score / 10]);
}

//7-3 三角形判断
void ex_7_3()
{
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);
	if (!(a + b > c && a + c > b && b + c > a)) {
		printf("Not a triangle\n");
	}
	else if (a * a + b * b == c * c || a * a == b * b + c * c || b * b == c * c + a * a) {
		if (a == b || b == c || a == c) {
			printf("Isosceles Right triangle\n");
		}
		else {
			printf("Right triangle\n");
		}
	}
	else if (a == b && b == c) {
		printf("Equilateral triangle\n");
	}
	else if (a == b || b == c || a == c) {
		printf("Isosceles triangle\n");
	}
	else {
		printf("General triangle\n");
	}
}

//7-4 级数求和
void ex_7_4()
{
	int k;
	int n = 1;
	double s = 1;
	scanf("%d", &k);
	while (s <= k) {
		n++;
		s += 1.0 / n;
	}
	printf("%d", n);
}

//7-5 12-24小时制
void ex_7_5()
{
	int minute, hour;

	scanf("%d:%d", &hour, &minute);

	if (hour < 12) {
		printf("%d:%d AM", hour, minute);
	}
	else if (hour == 12) {
		printf("%d:%d PM", hour, minute);
	}
	else {
		printf("%d:%d PM", hour - 12, minute);
	}
}

//7-5 然后是几点
void ex_7_6()
{
	int current_time, elapsed_minutes;

	scanf("%d%d", &current_time, &elapsed_minutes);

	int end_minute = current_time / 100 * 60 + current_time % 100 + elapsed_minutes;

	printf("%d%02d", end_minute / 60, end_minute % 60);
}
int main()
{
	ex_7_1();
}